fix(security): remove internal infra hostnames from published package#8
Open
andrei-hasna wants to merge 1 commit into
Open
fix(security): remove internal infra hostnames from published package#8andrei-hasna wants to merge 1 commit into
andrei-hasna wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/server/cloud/openapi.ts: the OpenAPI document'sservers[0].urlshipped a real internal hostname (https://logs.hasna.xyz). Replaced with the neutral, non-resolving placeholderhttps://your-deployment.example(plus adescriptiontelling operators to point it at their own deployment). Widened the localOpenApiDocservers type to allow the (optional, spec-legal)descriptionfield.src/lib/cloud-store.ts: neutralized the illustrativehttps://logs.hasna.xyz/v1/logsexample in a doc comment. No functional change here — the actual default-hostname-guessing logic lives in the shared@hasna/contractsdependency (resolveStorageClient), which is fixed separately in fix(security): remove internal infra hostnames from published package contracts#18.src/lib/cloud-store.test.ts: updated fixtures/expectations/test titles to the neutral placeholder domain.Why
Public npm package shipped a real internal hostname in a checked-in OpenAPI spec and doc comments.
Note on test/typecheck execution in this environment
This repo declares
@hasna/contracts,@hasna/mcp-harness, and@hasna/agent-registryasfile:../<sibling>devDependencies pointing at sibling monorepo directories that don't exist in a standalone clone, sobun installcan't fully resolve them here andbun run typecheck/bun testshow pre-existing failures unrelated to this change. Verified this is 100% pre-existing by diffing typecheck error counts and full-suite pass/fail counts between this branch and unmodifiedmain— identical in both cases (35 typecheck errors; 324 pass / 41 fail / 3 errors inbun test). This PR introduces zero new failures.Test plan
npx tsc --noEmit— 35 errors, identical count/content to unmodifiedmain(all pre-existing missing-sibling-package errors); the one NEW error my change initially introduced (serverstype mismatch from addingdescription) was fixed by widening the type, and is confirmed gonebun test(full suite) — 324 pass / 41 fail / 3 errors, byte-for-byte identical to unmodifiedmaingrep -rn "hasna\.xyz"across the repo — zero matches after this change